#ifndef __I386_KERNEL_PAGE_H__
#define __I386_KERNEL_PAGE_H__

/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT      12
#define PAGE_SIZE       (1UL << PAGE_SHIFT)
#define PAGE_MASK       (~(PAGE_SIZE-1))

// PAE
// i386提供了更多地址总线，使得访问物理内存的能力提升到 64G
extern unsigned long long __supported_pte_mask;
typedef struct { unsigned long pte_low, pte_high; } pte_t;
typedef struct { unsigned long long pmd; } pmd_t;
typedef struct { unsigned long long pgd; } pgd_t;
typedef struct { unsigned long long pgprot; } pgprot_t;
#define pmd_val(x)      ((x).pmd)
#define pte_val(x)      ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
#define __pmd(x) ((pmd_t) { (x) } )
#define HPAGE_SHIFT     21


#define __PAGE_OFFSET           (0xC0000000)

#define PAGE_OFFSET             ((unsigned long)__PAGE_OFFSET)

#endif  // __I386_KERNEL_PAGE_H__
